<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>
	<script>	

		// document.onkeydown = function () {
		// 	console.log('down');
		// }
		document.onkeypress = function (e) {
			console.log(String.fromCharCode(e.charCode));//可返回阿斯克码，转换为英文字符
		}
		// document.onkeyup = function   () {
		// 	console.log('up');
		// }
		
	</script>
</body>
</html>